<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录页面</title>
  <script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
    <style>
        .hr1{
            height: 5px;border:none;border-top:5px dashed #e3076f;
            width: 80%;
        }
        .hr2{
            height: 5px;border:none;border-top:5px dashed #19dc19;width: 80%;
        }
        .fontTr{
            color: brown;
            font-weight: bold;
        }
    </style>
</head>
<body>
 <div id="content">
     <input name="username" id="username" type="text" style="height: 30px;width: 200px"/>
     <input name="password" id="password" type="password" style="height: 30px;width: 200px"/>
     <button type="button" id="loginBtn">登录</button>
 </div>
</body>
<script>
  $(function (){
        $("#loginBtn").click(function (){
            var username = $("#username").val();
            var password = $("#password").val();
            var preUrl = window.location.href;
            if(preUrl){
                preUrl=preUrl.split("preUrl=")[1];
            }
            if(username && password){
                $.get("/sso/login/toLogin?username="+username+"&password="+password,function (){
                    if(preUrl){
                        //window.atob("aHR0cDovL2xvY2FsaG9zdDoxNzA4MC9zc28vYXBpLmh0bWw=")
                        // 'http://localhost:17080/sso/api.html'
                        window.location.href=window.atob(preUrl);
                    }
                });
            }
        });
  });
</script>
</html>